package com.manager.commons.message;

import java.io.BufferedInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;

import com.manager.commons.Path;

/**
 * 
 * Copyrights 1997-2008 西安协同时光软件有限公司
 * 
 * Filename:loadMessage.java
 * 
 * Description:读取配置文件
 * 
 * Version:V0.1
 * 
 * Author: peigen
 * 
 * History: [ Author Date Version Content ] peigen 2008-07-29 V0.1 create
 * 
 */
public class LoadMessage {
	
	public static void main(String[] args) {
		LoadMessage lm = new LoadMessage();
		try {
			System.out.println(lm.loadProperty().getProperty("errorPage"));
			System.out.println(lm.loadProperty().getProperty("nullName"));
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
	
	public Properties loadProperty() throws IOException{
		Path path = new Path();
		String propertyName = path.getClassParentPath(this.getClass()) + "/createXmlTree.properties";
		InputStream is = new BufferedInputStream(new FileInputStream(propertyName));
		Properties properties = new Properties();
		properties.load(is);
		return properties;
	}

}
